clear

% Load the dataset
load('tlDatasets.mat')

% Generate the GM models
fprintf('Fitting house A \n');
[GMa, LABELSa] = gm_fit_sensors(houseA);
fprintf('Fitting house B \n');
[GMb, LABELSb] = gm_fit_sensors(houseA);

% Compute distance values
for i=1:length(GMa),
    for j=1:length(GMb),
        if ( strcmp( class(cell2mat(GMa(i))) , 'struct') == 1 && strcmp( class(cell2mat(GMb(j))) , 'struct') ),
            fprintf('dist(%d, %d)\n',i,j);
            dist(i,j) = gm_distance_L2(cell2mat(GMa(i)), cell2mat(GMb(j)));
            dist = dist;
        else
            dist(i,j) = NaN;
        end
    end
end